package com.neulogistics.core.customercenter.api.application.rpc;

import com.neulogistics.infrastructure.common.rpc.client.ProcuredCenterClient;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CustomerCenterRPC implements ICustomerCenterRPC {
    @Resource
    ProcuredCenterClient procuredCenterClient;

    @Override
    public Boolean checkGoodsCanReturn(Integer goodsId) {
        Boolean optReturn = procuredCenterClient.checkGoodsCanReturn(goodsId).getData();

        return optReturn == null ? Boolean.FALSE : optReturn;
    }

    @Override
    public Boolean checkGoodsCanExchange(Integer goodsId) {
        Boolean optExchange = procuredCenterClient.checkGoodsCanExchange(goodsId).getData();

        return optExchange == null ? Boolean.FALSE : optExchange;
    }
}
